package extension.poker.zone;

import com.smartfoxserver.v2.core.SFSEventType;
import extension.game.zone.GameZoneExtension;
import log.Debug;

/**
 *
 * @author daz
 */
public class PokerZoneExtension extends GameZoneExtension {

    @Override
    public void init() {
        zoneName = "PokerZone";
        roomPrefix = "R";
        extensionClass = "extension.game.poker.PokerRoomExtension";
        startupExtension();

    }

    @Override
    public void addHandler() {
        addEventHandler(SFSEventType.USER_JOIN_ROOM, JoinRoomHandler.class);
        if (!Debug.isDebug) {
            addEventHandler(SFSEventType.USER_LOGIN, LoginEventHandler.class);
        }
        addRequestHandler(Command.LIST_TABLE, ListTableInfoHandler.class);
        addRequestHandler(Command.TABLE_INFO, TableInfoHandler.class);
        addEventHandler(SFSEventType.USER_JOIN_ZONE, OnCountHandler.class);
        addEventHandler(SFSEventType.USER_DISCONNECT, OnCountHandler.class);
    }


    @Override
    public PokerZoneResponse getResponse() {
        return (PokerZoneResponse) this.response;
    }

    @Override
    public void initResponse() {
        this.response = new PokerZoneResponse(this);
    }
}
